<template>
  <view class="navBar" :style="{ paddingTop: safeArea.top + 'px' }">
    <view>
      <view class="title">
        <text>{{ title }}</text>
      </view>
      <view class="search">
        <!-- <text class="input">搜索</text> -->
        <uni-search-bar
          class="input"
          radius="5"
          placeholder="搜索"
          clearButton="auto"
          cancelButton="none"
          @confirm="search"
        />
      </view>
    </view>
  </view>
</template>

<script>
import { mapState } from "vuex";
export default {
  props: {
    title: {
      type: String,
    },
  },
  data() {
    return {
      searchValue: "",
    };
  },
  computed: {
    ...mapState(["safeArea"]),
  },
  methods: {
    search(e) {
      console.log(e);
    },
  },
};
</script>

<style lang="scss">
.navBar {
  width: 100vh;
  height: 180rpx;
  background-color: #eb4450;
  .title {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80rpx;
    // background-color: pink;
    text {
      font-size: 33rpx;
      color: white;
    }
  }
  .search {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100rpx;
    // background-color: skyblue;
    .input {
      height: 110rpx;
      width: 93.3vw;
    }
  }
}
</style>
